package com.asp.aspchain.transaction.elastic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class JobStarter {
	@Autowired
	private ElasticJobConfig elasticJobConfig;
	@Autowired
	private NotifyJob notifyJob;
	@Value("${notify.cron}")
	String notify_cron;
	@Value("${notify.shardingTotalCount}")
	Integer notify_shardingTotalCount;
	@Value("${notify.shardingItemParameters}")
	String notify_shardingItemParameters;

	@PostConstruct
	public void Start() {
		elasticJobConfig.simpleJobScheduler(notifyJob, notify_cron, notify_shardingTotalCount, notify_shardingItemParameters);
	}
}
